package org.example.scenicspot.controller;

import org.example.scenicspot.domain.EmergencyRescueVehicle;
import org.example.scenicspot.domain.Staff;
import org.example.scenicspot.service.emergencyRescueVehicleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/")
public class emergencyRescueVehicleController {
    @Autowired
    emergencyRescueVehicleService emergencyRescueVehicleService;
    @GetMapping("/emergencyRescueVehicle")
    public List<EmergencyRescueVehicle> showemergencyRescueVehicle(){
        return emergencyRescueVehicleService.showemergencyRescueVehicle();
    }

    @GetMapping ("/searchemergencyRescueVehicle")
    public List<EmergencyRescueVehicle> searchemergencyRescueVehicle(String keyword){
        return emergencyRescueVehicleService.searchemergencyRescueVehicle(keyword);
    }

    @GetMapping ("/selectemergencyRescueVehiclebyscenicareaid")
    public List<EmergencyRescueVehicle> selectEmergencyRescueVehicleByScenicAreaID(int scenicareaid){
        return emergencyRescueVehicleService.selectByScenicAreaID(scenicareaid);
    }

    @GetMapping ("/deleteemergencyRescueVehicle")
    public void deleteemergencyRescueVehicle(int id){
        emergencyRescueVehicleService.deleteemergencyRescueVehicle(id);
    }

    @PostMapping("/insertemergencyRescueVehicle")
    public void insertemergencyRescueVehicle(@RequestBody EmergencyRescueVehicle emergencyRescueVehicle){
        emergencyRescueVehicleService.insertemergencyRescueVehicle(emergencyRescueVehicle);
    }

    @PostMapping ("/updateemergencyRescueVehicle")
    public void updateemergencyRescueVehicle(@RequestBody EmergencyRescueVehicle emergencyRescueVehicle){
        emergencyRescueVehicleService.updateemergencyRescueVehicle(emergencyRescueVehicle);
    }
}
